//统一管理咱们项目用户相关的接口
import request from "@/utils/request"
//项目配送相关的请求地址
const API = {
  DISTRIBUTION_FEE_URL: "/super/distribution_fee/index",
  DISTRIBUTION_FEE_CONFIG_URL: "/super/distribution_fee/config",
  DISTRIBUTION_STORE_URL: "/super/distribution_fee/store",
  DISTRIBUTION_LIST_URL: "/super/distribution_fee/list",
  DISTRIBUTION_DETAIL_URL: "/super/distribution_fee/show",
  DISTRIBUTION_DESTROY_URL: "/super/distribution_fee/destroy",
}

//获取默认配送费
export const distribution = () =>
  request.get(API.DISTRIBUTION_FEE_URL)

//设置默认配送费
export const distributionConfig = (data) =>
  request.post(API.DISTRIBUTION_FEE_CONFIG_URL, data)

//添加配送方案
export const store = (data) =>
  request.post(API.DISTRIBUTION_STORE_URL, data)

//获取配送费方案列表
export const list = () =>
  request.get(API.DISTRIBUTION_LIST_URL)

//获取配送费方案详情
export const detail = (params) =>
  request.get(API.DISTRIBUTION_DETAIL_URL, { params })

//删除配送费方案
export const destroy = (data) =>
  request.post(API.DISTRIBUTION_DESTROY_URL, data)